home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / vsa25611.zip / VSA256.TXT < prev    next >
Text File  |  1992-07-01  |  31KB  |  1,041 lines

  1.  
  2.                 VSA256
  3.                Graphics Library
  4.  
  5.               For C Programmers
  6.  
  7.                  Version 1.1
  8.                 June 30, 1992
  9.  
  10.  
  11.               Copyright Spyro Gumas, 1992.
  12.               All Rights Reserved
  13.  
  14.  
  15.                     
  16.  
  17. VESA256 Graphics Library for C Programmers              June 30, 1992
  18. Version 1.1
  19.  
  20. 1.0 Introduction                                        3
  21. 2.0 The Programming Environment                         4
  22.     2.1 Setting Up The VESA Environment             4
  23.     2.2 Global Graphics Parameters                  4
  24. 3.0 Function Descriptions                               5
  25.     3.1 VESA Configuration Functions                5
  26.         3.1.1 vsa_set_svga_mode                 5
  27.         3.1.2 vsa_get_svga_mode                 6
  28.         3.1.3 vsa_init                          6
  29.     3.2 Miscellaneous Functions                     7
  30.         3.2.1 vsa_set_display_start             7
  31.         3.2.2 vsa_get_display_start             7
  32.     3.3 Attribute Functions                         8
  33.         3.3.1 vsa_set_color                     8
  34.         3.3.2 vsa_set_text_color                8
  35.     3.4 Color Look Up Table Functions               9
  36.         3.4.1 vsa_read_color_register           9
  37.         3.4.2 vsa_write_color_register          9
  38.         3.4.3 vsa_read_color_block              10
  39.         3.4.4 vsa_write_color_block             10
  40.     3.5 Text Functions                              11
  41.         3.5.1 vsa_set_text_cursor               11
  42.         3.5.2 vsa_set_text_cursor_mode          11
  43.         3.5.3 vsa_write_char                    11
  44.         3.5.4 vsa_write_string                  12
  45.         3.5.5 vsa_write_string_alt              12
  46.     3.6 Basic Drawing Functions                     12
  47.         3.6.1 vsa_move_to                       12
  48.         3.6.2 vsa_set_pixel                     13
  49.         3.6.3 vsa_line_to                       13
  50.         3.6.4 vsa_rect_fill                     13
  51.         3.6.5 vsa_rect                          13
  52.         3.6.6 vsa_h_line                        14
  53.         3.6.7 vsa_v_line                        14
  54.     3.7 Specialized Drawing Functions               14
  55.         3.7.1 vsa_raster_line                   14
  56. 4.0 Nitty Gritties                                      15
  57.     4.1 Registration Information                    15
  58.     4.2 Software License                            15
  59.     4.3 Disclaimer                                  15
  60.     4.4 Technical Support                           16
  61. 5.0 Coming Attractions                                  17
  62.     5.1 Graphics Library Extensions                 17
  63. 6.0 Appendix                                            18
  64.     6.1 VSA.H Include File                          18
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.                 Page: 2
  72.                     
  73.  
  74. VESA256 Graphics Library for C Programmers              June 30, 1992
  75. Version 1.1
  76.  
  77. 1.0 Introduction
  78.  
  79.     The Video Electronics Standards Association (VESA) has 
  80. developed a set of BIOS extensions which standardize the Super VGA 
  81. (SVGA) graphics environment.  The VSA256 Graphics Library provides a C 
  82. programmer with the tools necessary to drive  a video adapter running 
  83. with the VESA version 2.0 BIOS extensions.  The name "VSA256" reflects 
  84. the fact that this library is primarily aimed at supporting the 256 
  85. color video modes 100h, 101h, 103h, 105h, and 107h defined within the 
  86. VESA standard (See table in section 3.1.1).
  87.     This is a revision to the original shareware version of VSA256 
  88. Graphics Library.  The major changes are listed below:
  89.  
  90.         - One library for all memory models
  91.         - Support for Borland C as well as Microsoft C
  92.         - New routine, vsa_set_text_cursor
  93.         - New routine, vsa_set_text_cursor_mode
  94.         - New routine, vsa_write_string_alt
  95.  
  96.     The distribution of the VSA256 Graphics Library consists of the 
  97. 7 files listed below plus the drivers listed in Section 2.1.  These 
  98. files are archived in the self extracting file VSA256.EXE.  To extract, 
  99. just type VSA256 in the directory that you want the files extracted to.  
  100. When distributing the VSA256 Graphics Library, distribute VSA256.EXE 
  101. instead of the individual files.
  102.  
  103. VSA_DEMO.C      Demonstration program (Source Code).
  104. VSA_DEMO.EXE    Demonstration program (Executable).
  105. VSA256MS.LIB    VSA256 Graphics Library (Microsoft C compatible).
  106. VSA256BC.LIB    VSA256 Graphics Library (Borland C Compatible).
  107. VSA.H           Include file required in your program.
  108. VSA256.TXT      This text document.
  109. ORDER.TXT       A text file order form for upgrades and registration.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                 Page: 3
  129.                     
  130.                     
  131. VESA256 Graphics Library for C Programmers              June 30, 1992
  132. Version 1.1
  133.  
  134. 2.0 The Programming Environment
  135.  
  136. 2.1 Setting Up The VESA Environment
  137.  
  138.     The VSA256 Graphics Library works with any (any?) IBM PC, XT, 
  139. AT or  compatible computer equipped with an SVGA video adapter card 
  140. capable of 256 colors.  A math coprocessor chip is not required, however 
  141. if it exists, this library will take advantage of it.
  142.     Before using the VSA256 Graphics Library, the VESA BIOS 
  143. Extensions must be loaded.  This is accomplished by executing the 
  144. appropriate driver or adding it to your AUTOEXEC.BAT file.  If your 
  145. video adapter card came with a VESA driver, use it.  Otherwise use one 
  146. of the drivers provided depending on the video adapter card installed in 
  147. the PC as follows:
  148.  
  149. APPIAN          \APPIAN\APVESA.EXE
  150. ATI             \ATI\VESA.COM
  151. C&T             \C&T\VESA451.COM (or VESA452.COM)
  152. CIRRUS          \CIRRUS\CRUSVESA.COM
  153. EVEREX          \EVEREX\EVRXVESA.COM
  154. GENOA           \GENOA\VESA.COM
  155. OAK             \OAK\37VESA.COM (or67VESA.COM)
  156. ORCHID          \ORCHID\ORCHDVSA.COM
  157. PARADISE        \PARADISE\VESA.EXE
  158. SIGMA           \SIGMA\SIGVESA.COM
  159. STB             \STB\STB-VESA.COM
  160. TECMAR          \TECMAR\VGAVESA.COM
  161. TRIDENT         \TRIDENT\VESA.EXE
  162. VIDEO7          \VIDEO7\V7VESA.COM
  163.  
  164. 2.2 Global Graphics Parameters
  165.  
  166.     The file VSA.H is used as an include file during program 
  167. development.  This file includes all of the function prototypes and it 
  168. defines the global graphics parameters that describe the specific video 
  169. adapter installed in the PC (See Section 6.1).  The global graphics 
  170. parameters are initialized by the vsa_init function and are described 
  171. below:
  172.  
  173. XResolution:    Unsigned, the number of screen pixels across (x 
  174.         dimension).
  175. YResolution:    Unsigned, the number of screen pixels high (y 
  176.         dimension).
  177. XCharResolution:Unsigned, the number of screen characters across (x 
  178.         dimension).
  179. YCharResolution:Unsigned, the number of screen characters high (y 
  180.         dimension).
  181. XCharSize:      Unsigned char, the character cell width.
  182. YCharSize:      Unsigned char, the character cell height.
  183. BitsPerPixel:   Unsigned char, the number of bits per pixel.
  184.  
  185.                 Page: 4
  186.                     
  187.                     
  188. VESA256 Graphics Library for C Programmers              June 30, 1992
  189. Version 1.1
  190.  
  191. 3.0 Function Descriptions
  192.  
  193.     This section describes the functions supported in the VSA256 
  194. Graphics Library.  To use these functions, link your program with the 
  195. appropriate library listed below depending on the compiler being used.
  196.  
  197.     Borland C++ or Turbo C  - VSA256BC.LIB
  198.     Microsoft C or Quick C  - VSA256MS.LIB
  199.  
  200.     In the following sections each function is listed along with a 
  201. definition of its inputs and return values.  A description is provided 
  202. followed by comments on the compatibility of the function with various 
  203. video modes.  Although many functions can drive non-VESA and non-256 
  204. color video modes, predictable operation requires that this software be 
  205. used with the 256 color VESA modes only.
  206.  
  207. 3.1 VESA Configuration Functions
  208.  
  209. 3.1.1 vsa_set_svga_mode(video_mode)
  210.  
  211. Inputs:         unsigned video_mode;
  212.  
  213. Returns:        unsigned fail_flag;
  214.  
  215. Description:    This routine sets the video mode.  The mode number may 
  216.     be any of the standard VESA SVGA mode numbers as defined in the 
  217.     tables below.  The mode is passed to this routine through the 
  218.     'video_mode' parameter.  This routine returns a 'fail_flag' = 0 
  219.     if the call was a success (a 1 for failure). It should be noted 
  220.     that this routine will also work with standard MDA, CGA, EGA, 
  221.     and VGA mode numbers, however the rest of the VSA256 functions 
  222.     will not necessarily work.
  223.  
  224. Comments:       Works in all VESA video modes.
  225.     Also works in MDA, CGA, EGA and VGA Modes.
  226.  
  227. WARNING: Use vsa_init Instead (Section 3.1.3)!  If you don't use 
  228. vsa_int, then the rest of the routines won't work because they depend on 
  229. the global parameters initialized by vsa_init;
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.                 Page: 5
  243.                     
  244.                     
  245. VESA256 Graphics Library for C Programmers              June 30, 1992
  246. Version 1.1
  247.  
  248. VESA SVGA VIDEO MODES
  249.  
  250. GRAPHICS                Mode            Resolution      Colors
  251.         100h            640x400         256
  252.         101h            640x480         256
  253.         102h            800x600         16
  254.         103h            800x600         256
  255.         104h            1024x768        16
  256.         105h            1024x768        256
  257.         106h            1280x1024       16
  258.         107h            1280x1024       256
  259.  
  260. TEXT            Mode            Columns         Rows
  261.         108h            80              60
  262.         109h            132             25
  263.         10Ah            132             43
  264.         10Bh            132             50
  265.         10Ch            132             60
  266.  
  267. 3.1.2 vsa_get_svga_mode(video_mode)
  268.  
  269. Inputs:         unsigned *video_mode;
  270.  
  271. Returns:        unsigned fail_flag;
  272.  
  273. Description:    This routine gets the current video mode.  The mode is 
  274.     returned to the calling routine via the 'video_mode' pointer.  
  275.     The mode number may be any of the standard VESA SVGA mode 
  276.     numbers as defined in Section 3.1.1.  This routine returns a 
  277.     'fail_flag' = 0 if the call was a success (a 1 for failure).           
  278.  
  279. Comments:       Works in all VESA video modes.
  280.     Also works in MDA, CGA, EGA and VGA Modes.
  281.  
  282. 3.1.3 vsa_init(video_mode)
  283.  
  284. Inputs:         unsigned video_mode;
  285.  
  286. Returns:        unsigned fail_flag;
  287.  
  288. Description:    This routine sets the video mode and initializes the 
  289.     VESA graphics environment.  This routine must be called prior 
  290.     to the use of any of the routines in Sections 3.4 through 3.7.  
  291.     The mode number may be any of the standard VESA SVGA mode 
  292.     numbers as defined in Section 3.1.1.  If the mode number is not 
  293.     a VESA SVGA mode number, this routine will still set the 
  294.     desired video mode, however, the VESA graphics environment will 
  295.     not be initialized and subsequent calls to drawing routines 
  296.     will produce unpredictable results.  The mode is passed to this 
  297.  
  298.  
  299.                 Page: 6
  300.                     
  301.                     
  302. VESA256 Graphics Library for C Programmers              June 30, 1992
  303. Version 1.1
  304.  
  305.     routine through the 'video_mode' parameter.  This routine 
  306.     returns a 'fail_flag' = 0 if the call was a success (a 1 for 
  307.     failure).
  308.  
  309. Comments:       Works in all VESA video modes.
  310.     Also works in MDA, CGA, EGA and VGA Modes.
  311.  
  312. 3.2 Miscellaneous Functions
  313.  
  314. 3.2.1 vsa_set_display_start(x_strt,y_strt)
  315.  
  316. Inputs:         unsigned x_strt,y_strt;
  317.  
  318. Returns:        unsigned fail_flag;
  319.  
  320. Description:    This routine sets the current start pixel address which 
  321.     is mapped to the upper left corner of the display.  This 
  322.     routine returns a 'fail_flag' = 0 if the call was a success (a 
  323.     1 for failure).
  324.  
  325. Comments:       Works in all VESA video modes.
  326.     Also works in MDA, CGA, EGA and VGA Modes.
  327.  
  328. 3.2.2 vsa_get_display_start(x_strt,y_strt)
  329.  
  330. Inputs:         unsigned *x_strt,*y_strt;
  331.  
  332. Returns:        unsigned fail_flag;
  333.  
  334. Description:    This routine gets the current start pixel address which 
  335.     is mapped to the upper left corner of the display.  This 
  336.     routine returns a 'fail_flag' = 0 if the call was a success (a 
  337.     1 for failure).                         
  338.  
  339. Comments:       Works in all VESA video modes.
  340.     Also works in MDA, CGA, EGA and VGA Modes.
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.                 Page: 7
  357.                     
  358.                     
  359. VESA256 Graphics Library for C Programmers              June 30, 1992
  360. Version 1.1
  361.  
  362. 3.3 Attribute Functions
  363.  
  364. 3.3.1 vsa_set_color(color)
  365.  
  366. Inputs:         unsigned char color;
  367.  
  368. Returns:        Nothing
  369.  
  370. Description:    This routine sets the current drawing color which is 
  371.     used in drawing pixels, lines, and rectangles.  The "color" is 
  372.     an 8 bit value from 0 to 255 which is used to index in to the 
  373.     Color Look Up Table (see Section 3.4).   
  374.  
  375. Comments:       Works only in 256 color VESA video modes.
  376.  
  377. 3.3.2 vsa_set_text_color(color)
  378.  
  379. Inputs:         unsigned char color;
  380.  
  381. Returns:        Nothing
  382.  
  383. Description:    This routine sets the current text color which is used 
  384.     in drawing text.  The "color" is an 8 bit value from 0 to 255 
  385.     which is used to index in to the Color Look Up Table (see 
  386.     Section 3.4).  In 16 color SVGA modes, the 4 LSBs define text 
  387.     color.  In 256 color SVGA modes, the 8 bits define text color.
  388.  
  389. Comments:       Works in all VESA video modes.
  390.     Also works in EGA and VGA Modes.
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.                 Page: 8
  414.                     
  415.                     
  416. VESA256 Graphics Library for C Programmers              June 30, 1992
  417. Version 1.1
  418.  
  419. 3.4 Color Look Up Table Functions
  420.  
  421.     The Color Look Up Table consists of 256 registers and each 
  422. register stores an 18 bit value defining 6 bit levels for each of red, 
  423. green, and blue.  The drawing functions index into the Color Look Up 
  424. Table with an 8 bit value (usually set with vsa_set_color) to determine 
  425. the drawing color. With the following functions, the Color Look Up Table 
  426. can be read or modified one register at a time or all at once in a block 
  427. operation.
  428.  
  429. 3.4.1 vsa_read_color_register(index,redptr,grnptr,bluptr)
  430.  
  431. Inputs:         unsigned index;
  432.         unsigned char *redptr,*grnptr,*bluptr;
  433.  
  434. Returns:        Nothing
  435.  
  436. Description:    This routine reads the value of one of the 256 color 
  437.     registers as defined by 'index'.  Pointers to the red, green, 
  438.     and blue components of the color are returned (6 bits each for 
  439.     red, green, and blue).
  440.  
  441. Comments:       Works in all VESA video modes.
  442.     Also works in EGA and VGA Modes.
  443.  
  444. 3.4.2 vsa_write_color_register(index,red,green,blue)
  445.  
  446. Inputs:         unsigned index;
  447.         unsigned char red,green,blue;
  448.  
  449. Returns:        Nothing
  450.  
  451. Description:    This routine writes the value of one of the 256 color 
  452.     registers as defined by 'index'.  The calling routine provides 
  453.     'red', 'green', and 'blue' components of the color (6 bits each 
  454.     for red, green, and blue).   
  455.  
  456. Comments:       Works in all VESA video modes.
  457.     Also works in EGA and VGA Modes.
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.                 Page: 9
  471.                     
  472.                     
  473. VESA256 Graphics Library for C Programmers              June 30, 1992
  474. Version 1.1
  475.  
  476. 3.4.3 vsa_read_color_block(start,count,array)
  477.  
  478. Inputs:         unsigned start,count;
  479.         unsigned char far array[];
  480.  
  481. Returns:        Nothing
  482.  
  483. Description:    This routine reads 'count' (Range: 1 to 256) 
  484.     consecutive color registers starting at 'start' (Range: 0 to 
  485.     255) within the Color Look Up Table.  The 'count' must be less 
  486.     than or equal to 256 - 'start'.  The values read from the color 
  487.     registers are returned from this routine in 'array[]'.  Each 
  488.     element of 'array[]' is a byte, and the size of 'array[]' is 
  489.     equal to three times 'count'.  Every three bytes in 'array[]' 
  490.     represents the red, green, and blue color values respectively 
  491.     for one color register.  Each color component (red,green, or 
  492.     blue) is a byte value but only ranges from 0 to 63.                                                            
  493.  
  494. Comments:       Works in all VESA video modes.
  495.     Also works in EGA and VGA Modes.
  496.  
  497. 3.4.4 vsa_write_color_block(start,count,array)
  498.  
  499. Inputs:         unsigned start,count;
  500.         unsigned char array[];
  501.  
  502. Returns:        Nothing
  503.  
  504. Description:    This routine writes 'count' (Range: 1 to 256) 
  505.     consecutive color registers starting at 'start' (Range: 0 to 
  506.     255) within the Color Look Up Table.  The 'count' must be less 
  507.     than or equal to 256 - 'start'.  The values loaded into the 
  508.     color registers are passed to this routine in 'array[]'.  Each 
  509.     element of 'array[]' is a byte, and the size of 'array[]' is 
  510.     equal to three times 'count'.  Every three bytes in 'array[]' 
  511.     represents the red, green, and blue color values respectively 
  512.     for one color register.  Each color component (red,green, or 
  513.     blue) is a byte value but only ranges from 0 to 63.                                            
  514.  
  515. Comments:       Works in all VESA video modes.
  516.     Also works in EGA and VGA Modes.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.                 Page: 10
  528.                     
  529.                     
  530. VESA256 Graphics Library for C Programmers              June 30, 1992
  531. Version 1.1
  532.  
  533. 3.5 Text Functions
  534.  
  535. 3.5.1 vsa_set_text_cursor(row,col)
  536.  
  537. Inputs:         unsigned row, col;
  538.  
  539. Returns:        Nothing
  540.  
  541. Description:    This routine sets the current text cursor position to 
  542.     'row, col' in character coordinates (not pixel coordinates).  
  543.     The current text cursor position is only used by 
  544.     vsa_write_string_alt.
  545.  
  546. Comments:       Works in all VESA video modes.
  547.     Also works in EGA and VGA Modes.
  548.  
  549. 3.5.2 vsa_set_text_cursor_mode(mode)
  550.  
  551. Inputs:         unsigned mode;
  552.  
  553. Returns:        Nothing
  554.  
  555. Description:    This routine determines the mode of the text cursor 
  556.     operation.  If 'mode' is '0' (the default after calling 
  557.     vsa_init), the text cursor is not updated after a new text 
  558.     string is written with vsa_write_string or 
  559.     vsa_write_string_alt.  If 'mode' is '1', then the text cursor 
  560.     is moved to the end of the text string after executing 
  561.     vsa_write_string or vsa_write_string_alt.
  562.  
  563. Comments:       Works in all VESA video modes.
  564.     Also works in EGA and VGA Modes.
  565.  
  566. 3.5.3 vsa_write_char(row,col,alpha)
  567.  
  568. Inputs:         unsigned char row,col;
  569.         char alpha;
  570.  
  571. Returns:        Nothing
  572.  
  573. Description:    This routine writes a the single character 'alpha' at 
  574.     position (row,col).  The character is written with the current 
  575.     text color.  After execution, the current text cursor position 
  576.     remains set to (row, col).
  577.  
  578. Comments:       Works in all VESA video modes.
  579.     Also works in EGA and VGA Modes.
  580.  
  581.  
  582.  
  583.  
  584.                 Page: 11
  585.                     
  586.                     
  587. VESA256 Graphics Library for C Programmers              June 30, 1992
  588. Version 1.1
  589.  
  590. 3.5.4 vsa_write_string(row,col,string)
  591.  
  592. Inputs:         unsigned char row,col;
  593.         char string[];
  594.  
  595. Returns:        Nothing
  596.  
  597. Description:    This routine writes a null terminated text string 
  598.     'string' at position (row,col).  The text is written with the 
  599.     current text color.  After execution, if the text cursor mode 
  600.     is '0', the text cursor remains at 'row,col', otherwise it is 
  601.     set to the end of the text string just written.
  602.  
  603. Comments:       Works in all VESA video modes.
  604.     Also works in EGA and VGA Modes.
  605.  
  606. 3.5.5 vsa_write_string_alt(string)
  607.  
  608. Inputs:         char string[];
  609.  
  610. Returns:        Nothing
  611.  
  612. Description:    This routine writes a null terminated text string 
  613.     'string' at the current text cursor position as determined by 
  614.     vsa_set_text_cursor.  The text is written with the current text 
  615.     color.  After execution, if the text cursor mode is '0', the 
  616.     current text cursor remains unchanged, otherwise it is set to 
  617.     the end of the text string just written.
  618.  
  619. Comments:       Works in all VESA video modes.
  620.     Also works in EGA and VGA Modes.
  621.  
  622. 3.6 Basic Drawing Functions
  623.  
  624. 3.6.1 vsa_move_to(x,y)
  625.  
  626. Inputs:         unsigned x,y;
  627.  
  628. Returns:        Nothing
  629.  
  630. Description:    This routine sets the current cursor position to 'x,y'.  
  631.     The current cursor position is used by the vsa_line_to, 
  632.     vsa_rect_fill, and vsa_rect functions.
  633.  
  634. Comments:       none
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.                 Page: 12
  642.                     
  643.                     
  644. VESA256 Graphics Library for C Programmers              June 30, 1992
  645. Version 1.1
  646.  
  647. 3.6.2 vsa_set_pixel(x,y)
  648.  
  649. Inputs:         unsigned x,y;
  650.  
  651. Returns:        Nothing
  652.  
  653. Description:    This routine draws a single pixel at 'x,y' with the 
  654.     current drawing color.
  655.  
  656. Comments:       Works in all VESA 256 color video modes.
  657.  
  658. 3.6.3 vsa_line_to(x,y)
  659.  
  660. Inputs:         int x,y;
  661.  
  662. Returns:        Nothing
  663.  
  664. Description:    This routine draws a line from the current cursor 
  665.     position to 'x,y' with the current drawing color.  Then the 
  666.     current cursor position is moved to 'x,y'.                                            
  667.  
  668. Comments:       Works in all VESA 256 color video modes.
  669.  
  670. 3.6.4 vsa_rect_fill(x,y)
  671.  
  672. Inputs:         int x,y;
  673.  
  674. Returns:        Nothing
  675.  
  676. Description:    This routine draws a filled rectangle from the current 
  677.     cursor position to the rectangles diagonal position 'x,y' with 
  678.     the current color.
  679.  
  680. Comments:       Works in all VESA 256 color video modes.
  681.  
  682. 3.6.5 vsa_rect(x,y)
  683.  
  684. Inputs:         int x,y;
  685.  
  686. Returns:        Nothing
  687.  
  688. Description:    This routine draws a rectangle from the current cursor 
  689.     position to the rectangles diagonal position 'x,y' with the 
  690.     current color.
  691.  
  692. Comments:       Works in all VESA 256 color video modes.
  693.  
  694.  
  695.  
  696.  
  697.  
  698.                 Page: 13
  699.                     
  700.                     
  701. VESA256 Graphics Library for C Programmers              June 30, 1992
  702. Version 1.1
  703.  
  704. 3.6.6 vsa_h_line(y,x0,x1)
  705.  
  706. Inputs:         int y,x0,x1;
  707.  
  708. Returns:        Nothing
  709.  
  710. Description:    This routine draws a horizontal line from 'x0,y' to 
  711.     'x1,y'.  The line is drawn with the current drawing color.  For 
  712.     horizontal lines this function is quicker than the vsa_line_to 
  713.     function.
  714.  
  715. Comments:       Works in all VESA 256 color video modes.
  716.  
  717. 3.6.7 vsa_v_line(x,y0,y1)
  718.  
  719. Inputs:         int x,y0,y1;
  720.  
  721. Returns:        Nothing
  722.  
  723. Description:    This routine draws a vertical line from 'x,y0' to 
  724.     'x,y1'.  The line is drawn with the current drawing color.  For 
  725.     vertical lines this function is quicker than the vsa_line_to 
  726.     function.
  727.  
  728. Comments:       Works in all VESA 256 color video modes.
  729.  
  730. 3.7 Specialized Drawing Functions
  731.  
  732. 3.7.1 vsa_raster_line(x0,x1,y,array)
  733.  
  734. Inputs:         unsigned x0,x1,y;
  735.         unsigned char array[];
  736.  
  737. Returns:        Nothing
  738.  
  739. Description:    This routine draws a horizontal raster line from 'x0,y' 
  740.     to 'x1,y'.  The 'array[]' values specify each pixel's color 
  741.     value.  If x0 <= x1, then 'array[0]' defines the color of the 
  742.     first pixel in the line at 'x0,y'.  If x1 < x0, then 'array[0]' 
  743.     defines the color of the first pixel in the line at 'x1,y'.                                                        
  744.  
  745. Comments:       Works in all VESA 256 color video modes.
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.                 Page: 14
  756.                     
  757.                     
  758. VESA256 Graphics Library for C Programmers              June 30, 1992
  759. Version 1.1
  760.  
  761. 4.0 Nitty Gritties
  762.  
  763. 4.1 Registration Information
  764.  
  765.     If you find the VSA256 Graphics Library useful, a registration 
  766. of $20 would be appreciated.  If you register, you will receive a 
  767. diskette and manual for the next upgrade of the software (see Section 
  768. 5.0 Coming Attractions).
  769.  
  770.       Please state the version number of the software you are 
  771. presently using.  Send check or money order to:
  772.  
  773.             Spyro Gumas
  774.             1668 Shady Brook Drive
  775.             Fullerton, Ca. 92631
  776.  
  777. 4.2 Software License
  778.  
  779. VSA256 Graphics Library, Version 1.0
  780. Copyright Spyro Gumas, 1992.  All Rights Reserved.
  781.  
  782. You are free to copy and distribute the VSA256 Graphics Library if:
  783.  
  784. 1)      It is used strictly for non-commercial purposes.
  785. 2)      No fee is charged for use, copying or distribution.
  786. 3)      It is not modified in any way.
  787.  
  788.     Clubs and user groups may charge a nominal fee not to exceed 
  789. ($10) for expenses and handling while distributing the VSA256 Graphics 
  790. Library.
  791.  
  792.     Site licenses and commercial licenses for the VSA256 Graphics 
  793. Library are available.  Consult the file ORDER.TXT for more information, 
  794. or contact me for more information.
  795.  
  796. 4.3 Disclaimer
  797.  
  798.     This software is provided "as is".  All warranties relating to 
  799. this software are disclaimed, whether expressed or implied, including 
  800. without limitation any implied warranties of merchantability or fitness 
  801. for a particular purpose.  Neither the author nor an agent of the author 
  802. will be liable for any special, incidental, consequential, indirect or 
  803. similar damages due to loss of data or any other reason, even if the 
  804. author or an agent of the author has been advised of the possibility of 
  805. such damages.  In no event shall the author's or an agent of the 
  806. author's liability for any damages ever exceed the price paid for the 
  807. license to use software, regardless of the form of the claim.  The 
  808. person using the software bears all risk as to the quality and 
  809. performance of the software.
  810.  
  811.  
  812.                 Page: 15
  813.                     
  814.                     
  815. VESA256 Graphics Library for C Programmers              June 30, 1992
  816. Version 1.1
  817.  
  818. 4.4 Technical Support
  819.  
  820.     If you have any questions or comments about the VSA256 Graphics 
  821. Library, please write me at:
  822.  
  823.             Spyro Gumas
  824.             1668 Shady Brook Drive
  825.             Fullerton, Ca. 92631
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.                 Page: 16
  870.                     
  871.                     
  872. VESA256 Graphics Library for C Programmers              June 30, 1992
  873. Version 1.1
  874.  
  875. 5.0 Coming Attractions
  876.  
  877.     Version 2.0 of the VSA256 Graphics Library incorporates new 
  878. functions and drawing speed improvements while preserving compatibility 
  879. with the previous version.  With the $20 registration fee, you will 
  880. automatically receive this upgrade.  Some of the Version 2.0 new 
  881. functions are:
  882.  
  883. - vsa_triangle_fill:            General purpose triangle fill for n-gon 
  884.                 drawing, finite element models, etc.
  885.  
  886. - vsa_triangle_shade:           3D triangle fill using Gouraud shading 
  887.                 for light modelling effects.
  888.  
  889. - vsa_antialias_line:           Smooth line generation which eliminates 
  890.                 "the jaggies".
  891.  
  892. - vsa_circle:                   Circle drawing.
  893.  
  894. - vsa_arc:                      General arc sections.
  895.  
  896. 5.1 Graphics Library Extensions
  897.  
  898.     The VSA256 Graphics Library (Version 1.1 and higher) is a base 
  899. library which is supported by library extensions for more specialized 
  900. tasks.  New extensions will be developed periodically.  The current 
  901. extensions are:
  902.  
  903. TIFF256 Graphics Library Extension 1.0 - This library extension provides 
  904. functions which operate with Tagged Image File Format (TIFF) images.  
  905. With these functions, you can traverse the image file, extract image 
  906. information, and display the images as part of your own program.  The 
  907. image types supported include Bilevel, Grayscale, Palette Color and RGB 
  908. True Color.  This is shareware software available from the same place 
  909. that you got the VSA256 Graphics Library.
  910.  
  911. TIFF256 Graphics Library Extension 2.0 - This is the registered version 
  912. of the TIFF256 Graphics Library Extension.  In addition to the 
  913. capabilities provided by the version 1.0, version 2.0 lets you modify 
  914. the TIFF images and write them back to TIFF files.  Furthermore, any 
  915. image that you generate with VSA256 can be saved as a TIFF file.  You 
  916. can get your legal fingers on this with a $20 registration fee, or get 
  917. both VSA256 Ver. 2.0 and TIFF256 Ver 2.0 for the highly discounted price 
  918. of $30.  See the ORDER.TXT for ordering information.
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.                 Page: 17
  927.                     
  928.                     
  929. VESA256 Graphics Library for C Programmers              June 30, 1992
  930. Version 1.1
  931.  
  932. 6.0 Appendix
  933.  
  934. 6.1 VSA.H Include File
  935.  
  936. /*.................................. VSA.H ................. 5-8-92 ........*/
  937. /* This file declares the VSA256 Graphics Library functions and global      */
  938. /* parameters used throughout the graphics routines.                        */
  939. /*                                                                          */
  940. /*            Copyright Spyro Gumas, 1992.  All Rights Reserved.            */
  941. /*..........................................................................*/
  942.  
  943. /*..........................................................................*/
  944. /*                          Function Prototypes                             */
  945. /*..........................................................................*/
  946. unsigned  _far _cdecl vsa_set_svga_mode( unsigned );
  947. unsigned  _far _cdecl vsa_get_svga_mode( unsigned _far * );
  948. unsigned  _far _cdecl vsa_set_display_start( unsigned, unsigned );
  949. unsigned  _far _cdecl vsa_get_display_start( unsigned _far *,
  950.                 unsigned _far * );
  951. unsigned  _far _cdecl vsa_init( unsigned );
  952. void _far _cdecl vsa_set_color( unsigned );
  953. void _far _cdecl vsa_set_text_color( unsigned );
  954. void _far _cdecl vsa_set_text_cursor_mode( unsigned );
  955. void _far _cdecl vsa_set_text_cursor( unsigned, unsigned );
  956. void _far _cdecl vsa_write_char( unsigned, unsigned, char );
  957. void _far _cdecl vsa_write_string( unsigned, unsigned, unsigned, char _far * );
  958. void _far _cdecl vsa_write_string_alt( char _far * );
  959. void _far _cdecl vsa_read_color_register( unsigned, unsigned char _far *,
  960.              unsigned char _far *, unsigned char _far *);
  961. void _far _cdecl vsa_write_color_register( unsigned, unsigned char,
  962.              unsigned char, unsigned char );
  963. void _far _cdecl vsa_read_color_block( unsigned, unsigned,
  964.              unsigned char _far * );
  965. void _far _cdecl vsa_write_color_block( unsigned, unsigned,
  966.              unsigned char _far * );
  967. void _far _cdecl vsa_move_to( unsigned, unsigned );
  968. void _far _cdecl vsa_set_pixel( unsigned, unsigned );
  969. void _far _cdecl vsa_line_to( unsigned, unsigned );
  970. void _far _cdecl vsa_rect_fill( unsigned, unsigned );
  971. void _far _cdecl vsa_rect( unsigned, unsigned );
  972. void _far _cdecl vsa_h_line( unsigned, unsigned, unsigned );
  973. void _far _cdecl vsa_v_line( unsigned, unsigned, unsigned );
  974. void _far _cdecl vsa_raster_line( unsigned, unsigned,unsigned,
  975.              unsigned char _far *);
  976. void _far _cdecl vsa_about( void );
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.                 Page: 18
  984.                     
  985.                     
  986. VESA256 Graphics Library for C Programmers              June 30, 1992
  987. Version 1.1
  988.  
  989. /*..........................................................................*/
  990. /*                          Function Prototypes                             */
  991. /*   The following functions only work in VESA mode 105h (1024 x 768 x 8)   */
  992. /*   and should run a little faster, but they should only be used           */
  993. /*   experimentally cause they "aint really checked out".                   */
  994. /*..........................................................................*/
  995. void _far _cdecl vsa_line_to_x( unsigned, unsigned );
  996. void _far _cdecl vsa_rect_fill_x( unsigned, unsigned );
  997. void _far _cdecl vsa_h_line_x( unsigned, unsigned, unsigned );
  998. void _far _cdecl vsa_v_line_x( unsigned, unsigned, unsigned );
  999. void _far _cdecl vsa_raster_line_x( unsigned, unsigned,unsigned,
  1000.              unsigned char _far *);
  1001.  
  1002. /*..........................................................................*/
  1003. /*                    External Parameter Declarations                       */
  1004. /*..........................................................................*/
  1005. unsigned XResolution, YResolution, XCharResolution, YCharResolution;
  1006. unsigned char XCharSize, YCharSize;
  1007. unsigned char BitsPerPixel;
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.                 Page: 19
  1041.